import { requestApi } from "@/utils/request";
import type { getSearchTravelResponse,getSearchTravelListByKeywordsResponse,getSearchAuthorListByKeywordsResponse,getHotCityResponse } from "@/types/search-travel";
// 获取搜索关键词：游记和作者
export const getSearchTravelAPI = (params: any) => {
    return requestApi<getSearchTravelResponse>({
        url: '/search-travel',
        method: 'GET',
        data: params
    })
}

// 根据关键词搜索游记
export const getSearchTravelListByKeywordsAPI = (params: {
    keywords: string,
    page: number,
}) => {
    return requestApi<getSearchTravelListByKeywordsResponse>({
        url: '/paging-search-result',
        method: 'GET',
        data: params
    })
}

// 根据关键词搜索作者
export const getSearchAuthorListByKeywordsAPI = (params: {
    keywords: string,
    page: number,
}) => {
    return requestApi<getSearchAuthorListByKeywordsResponse>({
        url: '/search-author',
        method: 'GET',
        data: params
    })
}

// 获取10大热门旅游城市
export const getHotCityAPI = () => {
    return requestApi<getHotCityResponse>({
        url: '/hot-city',
        method: 'GET',
    })
}

// 关注作者
export const followAuthorAPI = (params: {
    im_concerned_uid: string,
}) => {
    return requestApi({
        url: '/follow-author',
        method: 'GET',
        data: params
    })
}

// 取消关注作者
export const unfollowAuthorAPI = (params: {
    im_concerned_uid: string,
}) => {
    return requestApi({
        url: '/unfollow-author',
        method: 'GET',
        data: params
    })
}